Telegram Group & Telegram Channel
SOLID Principles
(part 4)

رابع مبدأ(ISP) Interface segregation principle

- “ Clients should not be forced to depend on methods they do not use”

إذا كان يوجد كلاس يرث من Interface المفروض لا يعمل Impalement إلا للـ methods اللي هو يحتاجها .

لذلك عند بناء Interface يجب ان يكون كُل الـ methods الموجودة مرتبطة مع بعض مالم يتم تقسيمها إلا أكثر من Interface وهذا المبدأ شبيه إلا حدٍ ما من مبدأ SRP.

واقصد هُنا بالـ Interface أي جزء يستخدمه الـ client سواءً Class او Interface

مثلاً كان عندك Interface لطرق الدفع ، وشخص آخر حب يأخذ منك الواجهة هذي ويستخدمها في طريقة الدفع اونلاين

فأنت قولت له عشان تستخدم الواجهة لازم تعمل Implement للدالة الخاصة بالدفع اونلاين وكمان للدالة الخاصة بالدفع كاش عشان يشتغل معاك، طيب هو ما يحتاج الدفع كاش تجبره عليها ليش🙄؟

لذلك يتم تقسيم Interface وتكون كُل Interface خاصة بطريقة دفع مُعينه وبكذا حققنا مبدأ ISP وبنفس الوقت مبدأ SRP.

يتبع..



tg-me.com/beginprogrammer/639
Create:
Last Update:

SOLID Principles
(part 4)

رابع مبدأ(ISP) Interface segregation principle

- “ Clients should not be forced to depend on methods they do not use”

إذا كان يوجد كلاس يرث من Interface المفروض لا يعمل Impalement إلا للـ methods اللي هو يحتاجها .

لذلك عند بناء Interface يجب ان يكون كُل الـ methods الموجودة مرتبطة مع بعض مالم يتم تقسيمها إلا أكثر من Interface وهذا المبدأ شبيه إلا حدٍ ما من مبدأ SRP.

واقصد هُنا بالـ Interface أي جزء يستخدمه الـ client سواءً Class او Interface

مثلاً كان عندك Interface لطرق الدفع ، وشخص آخر حب يأخذ منك الواجهة هذي ويستخدمها في طريقة الدفع اونلاين

فأنت قولت له عشان تستخدم الواجهة لازم تعمل Implement للدالة الخاصة بالدفع اونلاين وكمان للدالة الخاصة بالدفع كاش عشان يشتغل معاك، طيب هو ما يحتاج الدفع كاش تجبره عليها ليش🙄؟

لذلك يتم تقسيم Interface وتكون كُل Interface خاصة بطريقة دفع مُعينه وبكذا حققنا مبدأ ISP وبنفس الوقت مبدأ SRP.

يتبع..

BY بدايه مبرمج




Share with your friend now:
tg-me.com/beginprogrammer/639

View MORE
Open in Telegram


بدايه مبرمج Telegram | DID YOU KNOW?

Date: |

Unlimited members in Telegram group now

Telegram has made it easier for its users to communicate, as it has introduced a feature that allows more than 200,000 users in a group chat. However, if the users in a group chat move past 200,000, it changes into "Broadcast Group", but the feature comes with a restriction. Groups with close to 200k members can be converted to a Broadcast Group that allows unlimited members. Only admins can post in Broadcast Groups, but everyone can read along and participate in group Voice Chats," Telegram added.

China’s stock markets are some of the largest in the world, with total market capitalization reaching RMB 79 trillion (US$12.2 trillion) in 2020. China’s stock markets are seen as a crucial tool for driving economic growth, in particular for financing the country’s rapidly growing high-tech sectors.Although traditionally closed off to overseas investors, China’s financial markets have gradually been loosening restrictions over the past couple of decades. At the same time, reforms have sought to make it easier for Chinese companies to list on onshore stock exchanges, and new programs have been launched in attempts to lure some of China’s most coveted overseas-listed companies back to the country.

بدايه مبرمج from hk


Telegram بدايه مبرمج
FROM USA